/**
 * @Author: guo-bomin 2974463764@qq.com
 * @Date: 2023-12-15 12:43:35
 * @LastEditors: guo-bomin 2974463764@qq.com
 * @LastEditTime: 2023-12-15 12:47:12
 * @FilePath: \NodeJs\wechat-test\app.js
 * @Description: 郭博民16670506200
 * @有问题微信同号询问，急事call我
 * @Copyright (c) 2023 by 湖南習羽网络科技有限公司, All Rights Reserved. 
 */

module.exports = app => {
 
	app.beforeStart(async () => {
		// 应用会等待这个函数执行完成才启动
		console.log("==app beforeStart==");
	});
 
    app.ready(async () => {
		console.log("==app ready==");
		let ctx = app.createAnonymousContext();
		await ctx.service.ernie.getAccessToken(); //请求AccessToken
		await ctx.service.wechat.startBot(); //初始化BOT
	})
 
	app.beforeClose(async () => {
		console.log("==app beforeClose==");
	})
};